package com.mk.common.util;

import java.util.HashMap;
import java.util.Map;

public enum StatusRefITSMEnum {
	SUCCESS("0", "219", "100130","100121"), //成功
    FAIL("1", null, null, null), //失败
    FALLBACK("2",null, null, null), //回退
    PARTFALLBACK("3", null, null, null), //部分回退
    NEW("4", null, null, null), //新建
    ABOLISH("5", null, null, null), //废止
    EDIT("6", null, null, null), //修改
    NULL("", null, null, null);

    private String itsmImplCode; //ITSM变更单实施代码
    private String devTaskStatus; //开发任务状态
    private String batchReqStatus; //批次需求任务
    private String busReqStatus; //业务需求状态

    public static Map<String, StatusRefITSMEnum> valMap = new HashMap<>();
    static {
    	valMap.put("0", SUCCESS);
    	valMap.put("1", FAIL);
    	valMap.put("2", FALLBACK);
    	valMap.put("3", PARTFALLBACK);
    }
    public static StatusRefITSMEnum getEnumByChgCode(String code) {
    	switch(code){
    		case "0": return SUCCESS;
    		case "1": return FAIL;
    		case "2": return FALLBACK;
    		case "3": return PARTFALLBACK;
    		case "4": return NEW;
    		case "5": return ABOLISH;
    		case "6": return EDIT;
    		default :return NULL;
    	}
    	
    }
    
    
    StatusRefITSMEnum (String itsmImplCode, String devTaskStatus, String batchReqStatus, String busReqStatus) {
        this.itsmImplCode = itsmImplCode;
        this.devTaskStatus = devTaskStatus;
        this.batchReqStatus = batchReqStatus;
        this.busReqStatus = busReqStatus;
    }
    public String getItsmImplCode() {
        return itsmImplCode;
    }
    public void setItsmImplCode(String itsmImplCode) {
        this.itsmImplCode = itsmImplCode;
    }
    public String getDevTaskStatus() {
        return devTaskStatus;
    }
    public void setDevTaskStatus(String devTaskStatus) {
        this.devTaskStatus = devTaskStatus;
    }
    public String getBatchReqStatus() {
        return batchReqStatus;
    }
    public void setBatchReqStatus(String batchReqStatus) {
        this.batchReqStatus = batchReqStatus;
    }
    public String getBusReqStatus() {
        return busReqStatus;
    }
    public void setBusReqStatus(String busReqStatus) {
        this.busReqStatus = busReqStatus;
    }
	
}
